<?php
require_once 'Datatype_integer.php';

/**
 * Formula datatype
 *
 * @package EDO
 * @subpackage Datatypes
 */
class Datatype_formula extends Datatype_integer {



	public function getValue()
	{
		if(LEAD::isRegistered('application'))
		{
		  $lead = LEAD::application();
		  $filename = $lead->root['customer'] . "/data/formulas/" . $this->getOwner()->getClass() . "_" . $this->getName() . ".emf";

		  return eval(file_get_contents($filename));

		}
	    else
	       return parent::getValue();
	}


}

?>